<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>2RTK NTRIP Caster</title>
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap');

        body {
            margin: 0;
            font-family: 'Orbitron', sans-serif;
            background: url('{{ url_for('static', filename='background.jpg') }}') no-repeat center center fixed;
            background-size: cover;
            color: #007bff;
            animation: bgScroll 100s linear infinite;
            position: relative;
        }

        @keyframes bgScroll {
            from { background-position: 0 0; }
            to { background-position: 100% 100%; }
        }

        /* 页头和导航栏容器 */
        .header-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 2;
            display: flex;
            flex-direction: column;
        }

        .header {
            text-align: center;
            padding: 0 20px;
            background-color: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(5px);
            box-shadow: 0 0 20px rgba(0, 123, 255, 0.4);
            position: relative;
        }

        .header-content {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            padding: 20px 0;
        }

        .header h1 {
            margin: 0;
            font-size: 2.5em;
            text-shadow: 0 0 10px #007bff;
            transition: font-size 0.3s ease;
        }

        .header p {
            font-size: 0.95em;
            color: #f8f9fa;
        }

        .header a {
            color: #007bff;
            text-decoration: none;
        }

        /* 优化菜单按钮样式 */
        .menu {
            display: flex;
            justify-content: center;
            gap: 15px;
            background-color: rgba(0, 0, 0, 0.9);
            padding: 12px;
            border-top: 1px solid #007bff22;
            border-bottom: 1px solid #007bff22;
            flex-wrap: wrap;
            position: relative;
            top: 0;
        }

        .menu a {
            color: #f8f9fa;
            text-decoration: none;
            font-weight: 700;
            font-size: 1em;
            transition: all 0.3s ease;
            padding: 8px 18px;
            border-radius: 6px;
            background-color: rgba(0, 123, 255, 0.15);
            border: 1px solid transparent;
        }

        .menu a:hover {
            color: #007bff;
            background-color: rgba(0, 123, 255, 0.25);
            border-color: #007bff;
            transform: translateY(-2px);
            box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
        }

        .menu a.active {
            background-color: rgba(0, 123, 255, 0.3);
            border-color: #007bff;
        }

        .content {
            background-color: rgba(0, 0, 0, 0.7);
            margin: 135px auto 100px;
            padding: 30px;
            border-radius: 12px;
            max-width: 960px;
            box-shadow: 0 0 40px rgba(0, 123, 255, 0.3);
            animation: fadeInUp 1.2s ease-out;
            overflow-y: auto;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        h2 {
            color: #007bff;
            border-bottom: 1px solid #007bff55;
            padding-bottom: 5px;
        }

        ul li {
            margin-bottom: 6px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #007bff;
        }

        .form-group input {
            width: 300px;
            padding: 10px;
            border: 1px solid #007bff;
            border-radius: 4px;
            font-size: 14px;
            background-color: rgba(0, 0, 0, 0.3);
            color: #007bff;
        }

        button {
            background-color: #007bff;
            color: white;
            padding: 10px 25px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin-right: 10px;
            font-family: 'Orbitron', sans-serif;
            transition: all 0.3s ease;
            border: 1px solid #007bff;
        }

        button:hover {
            background-color: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
        }

        .cancel-btn {
            background-color: #dc3545;
            color: white;
            border-color: #dc3545;
        }

        .cancel-btn:hover {
            background-color: #c82333;
            box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
        }

        @keyframes starBlink {
            0%, 100% {
                opacity: 0.6;
                transform: scale(0.8);
            }
            50% {
                opacity: 1;
                transform: scale(1.2);
                box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
            }
        }

        .star {
            position: absolute;
            border-radius: 50%;
            animation: starBlink 2s ease-in-out infinite;
        }

        .star-blue { background-color: #007bff; }
        .star-white { background-color: white; }
        .star-yellow { background-color: #ffffaa; }
        .star-purple { background-color: #cc99ff; }

        .user-info {
            color: #ffc107;
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.9em;
        }

        .user-info a {
            color: #ffc107;
            text-decoration: none;
            margin-left: 10px;
        }

        /* 缩小修改密码链接的字体 */
        .user-info .change-password {
            font-size: 0.8em;
        }

        .user-info a:hover {
            text-decoration: underline;
        }

        /* 底部字体缩小 */
        .footer {
            background-color: rgba(0, 0, 0, 0.8);
            text-align: center;
            padding: 15px;
            font-size: 0.8em; /* 底部字体整体缩小 */
            color: #f8f9fa;
            border-top: 1px solid #007bff22;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 2;
        }

        .footer-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-width: 960px;
            margin: 0 auto;
        }

        .footer-section {
            word-wrap: break-word;
            line-height: 1.5;
        }

        .footer-section a {
            color: #007bff;
            text-decoration: none;
        }

        .footer-section a:hover {
            text-decoration: underline;
        }

        .support-message {
            margin-top: 8px;
            font-size: 0.85em; /* 支持信息字体稍大但仍小于原来 */
        }

        .heart-symbol {
            color: #dc3545;
            font-size: 1.2em;
        }

        .footer-donate {
            margin-top: 12px;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
        }

        .footer-donate-button {
            position: relative;
            cursor: pointer;
        }

        .footer-qr-code {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            width: 200px;
            height: 200px;
            z-index: 1;
            border: 2px solid #007bff;
            border-radius: 8px;
            margin-bottom: 10px;
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .header {
                padding: 0 10px;
            }

            .header-content {
                padding: 15px 0;
            }

            .header h1 {
                font-size: 2em;
            }

            .menu {
                padding: 10px;
                gap: 10px;
            }

            .menu a {
                font-size: 0.95em;
                padding: 6px 12px;
            }

            .content {
                margin: 112px auto 80px;
                padding: 20px;
            }

            .user-info {
                font-size: 0.8em;
                right: 10px;
            }

            .footer {
                padding: 10px;
                font-size: 0.75em;
            }

            .support-message {
                font-size: 0.8em;
            }
        }
    </style>
</head>

<body>
    <!-- 页头和导航栏容器 -->
    <div class="header-container">
        <div class="header">
            <div class="header-content">
                <h1>2RTK NTRIP Caster</h1>
                <div class="user-info">
                    {% if session.admin %}
                    <span>Admin: {{ session.admin }}</span>
                    <a href="{{ url_for('change_admin_password') }}" class="change-password">ChangePassword</a>
                    <a href="{{ url_for('login', logout=1) }}">Logout</a>
                    {% else %}
                    <a href="{{ url_for('login') }}">Login</a>
                    {% endif %}
                </div>
            </div>
        </div>

        <div class="menu">
            <a href="{{ url_for('index') }}" {% if request.endpoint == 'index' %}class="active"{% endif %}>Home</a>
            <a href="{{ url_for('user_management') }}" {% if request.endpoint == 'user_management' %}class="active"{% endif %}>User</a>
            <a href="{{ url_for('mount_management') }}" {% if request.endpoint == 'mount_management' %}class="active"{% endif %}>Mount Point</a>
        </div>
    </div>

    <div class="content">
        {% block content %}
        {% endblock %}
    </div>

    <div class="footer">
        <div class="footer-content">
            <div class="footer-section">
                Visit <a href="http://www.2rtk.com" target="_blank">2RTK.com</a> for more information
            </div>
            <div class="footer-section">
                If you encounter any issues or have feedback during use, please contact the author 
                <a href="mailto:{{ CONTACT_EMAIL }}">{{ CONTACT_EMAIL }}</a>
            </div>
            <div class="footer-section support-message">
                <span style="color: #ffc107;">If you find it useful, please support the developers: 
                A small coffee's worth of kindness can make every line of code warmer. 
                Your recognition is our greatest motivation to stick to open source and keep iterating.</span>
            </div>
        </div>
    </div>

    <script>
        const starColors = ['star-blue', 'star-white', 'star-yellow', 'star-purple'];

        function createStar() {
            const star = document.createElement('div');
            const size = Math.floor(Math.random() * 4) + 2;
            const colorClass = starColors[Math.floor(Math.random() * starColors.length)];
            const duration = Math.random() * 2 + 1;

            star.classList.add('star', colorClass);
            star.style.width = `${size}px`;
            star.style.height = `${size}px`;
            star.style.left = `${Math.random() * window.innerWidth}px`;
            star.style.top = `${Math.random() * window.innerHeight}px`;
            star.style.animationDuration = `${duration}s`;

            document.body.appendChild(star);

            setTimeout(() => {
                star.style.transition = 'opacity 0.5s ease-out';
                star.style.opacity = '0';
                setTimeout(() => star.remove(), 500);
            }, duration * 1000 + 1000);
        }

        for (let i = 0; i < 10; i++) {
            setTimeout(createStar, i * 500);
        }

        setInterval(createStar, 5000);

        function showFooterQrCode(type) {
            document.getElementById(`footer-${type}-qr`).style.display = 'block';
        }

        function hideFooterQrCode(type) {
            document.getElementById(`footer-${type}-qr`).style.display = 'none';
        }

        // 当前页面菜单高亮
        document.addEventListener('DOMContentLoaded', function() {
            const currentPath = window.location.pathname;
            const menuLinks = document.querySelectorAll('.menu a');
            
            menuLinks.forEach(link => {
                if (link.getAttribute('href') === currentPath) {
                    link.classList.add('active');
                }
            });
        });
    </script>
</body>

</html>
    